home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / Motif-2.1 / include / Xm / TextStrSoP.h.z / TextStrSoP.h
C/C++ Source or Header  |  2002-10-15  |  4KB  |  129 lines

  1. /* 
  2.  *  @OSF_COPYRIGHT@
  3.  *  COPYRIGHT NOTICE
  4.  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  5.  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  6.  *  the full copyright text.
  7. */ 
  8. /* 
  9.  * HISTORY
  10. */ 
  11. /* $XConsortium: TextStrSoP.h /main/9 1995/07/13 18:11:11 drk $ */
  12. /* (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  13. /* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  14. #ifndef _XmTextStrSoP_h
  15. #define _XmTextStrSoP_h
  16.  
  17. #include <Xm/XmP.h>
  18. #include <Xm/Text.h>
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. /* see comment at the bottom of Xm.h */
  25. #if defined(_SGIBUGFIX) && !defined(_SGI_OSF_PUBLIC_SYMBOLS)
  26. typedef enum { EditDone, EditError, EditReject } XmTextStatus;
  27.  
  28. /* this one from XmP.h */
  29. typedef enum { XmsdLeft, XmsdRight } XmTextScanDirection;
  30. #endif /* _SGIBUGFIX */
  31.  
  32. /****************************************************************
  33.  *
  34.  * Definitions for use by sources and source users.
  35.  *
  36.  ****************************************************************/
  37.  
  38. typedef struct _XmSourceDataRec {
  39.   XmTextSource source;    /* Backpointer to source record. */
  40.   XmTextWidget *widgets;    /* Array of widgets displaying this source. */
  41.   XmTextPosition left, right; /* Left and right extents of selection. */
  42.   char * ptr;            /* Actual string data. */
  43.   char * value;        /* Value of the string data. */
  44.   char * gap_start;        /* Gapped buffer start pointer */
  45.   char * gap_end;        /* Gapped buffer end pointer */
  46.   char * PSWC_NWLN;           /* Holder for char*, short*, int* rep of NWLN */
  47.   int length;            /* Number of chars of data. */
  48.   int maxlength;        /* Space allocated. */
  49.   int old_length;        /* Space allocated for value pointer. */
  50.   int numwidgets;        /* Number of entries in above. */
  51.   int maxallowed;        /* The user is not allowed to grow source */
  52.   /* to a size greater than this. */
  53.   Time prim_time;             /* time of primary selection */
  54.   Boolean hasselection;    /* Whether we own the selection. */
  55.   Boolean editable;        /* Whether we allow any edits. */
  56.   Boolean take_selection;    /* Whether we should take the selection. */
  57. } XmSourceDataRec, *XmSourceData;
  58.  
  59. typedef void (*AddWidgetProc)(XmTextSource,
  60.                   XmTextWidget);
  61.  
  62. typedef int (*CountLinesProc)(XmTextSource,
  63.                   XmTextPosition,
  64.                   unsigned long);
  65.  
  66. typedef void (*RemoveWidgetProc)(XmTextSource,
  67.                  XmTextWidget);
  68.  
  69. typedef XmTextPosition (*ReadProc)(XmTextSource,
  70.                    XmTextPosition,    /* starting position */
  71.                    XmTextPosition,    /* The last position 
  72.                                we're interested in.
  73.                                Don't return info 
  74.                                about any later
  75.                                positions. */
  76.                    XmTextBlock);    /* RETURN: text read */
  77.  
  78. typedef XmTextStatus (*ReplaceProc)(XmTextWidget,
  79.                     XEvent *,
  80.                     XmTextPosition *,
  81.                     XmTextPosition *,
  82.                     XmTextBlock,
  83. #if NeedWidePrototypes
  84.                     int);
  85. #else
  86.                                     Boolean);
  87. #endif /* NeedsWidePrototypes */
  88.  
  89. typedef XmTextPosition (*ScanProc)(XmTextSource,
  90.                    XmTextPosition,
  91.                    XmTextScanType,
  92.                    XmTextScanDirection,    /*XmsdLeft/XmsdRight*/
  93.                    int,
  94. #if NeedWidePrototypes
  95.                    int);
  96. #else
  97.                                Boolean);
  98. #endif /* NeedsWidePrototypes */
  99.  
  100. typedef Boolean (*GetSelectionProc)(XmTextSource,
  101.                                     XmTextPosition *,
  102.                                     XmTextPosition *);
  103.  
  104. typedef void (*SetSelectionProc)(XmTextSource,
  105.                  XmTextPosition,
  106.                  XmTextPosition,
  107.                  Time);
  108.  
  109.  
  110. typedef struct _XmTextSourceRec {
  111.   struct _XmSourceDataRec *data;   /* Source-defined data (opaque type). */
  112.   AddWidgetProc    AddWidget;
  113.   CountLinesProc    CountLines;
  114.   RemoveWidgetProc    RemoveWidget;
  115.   ReadProc        ReadSource;
  116.   ReplaceProc        Replace;
  117.   ScanProc        Scan;
  118.   GetSelectionProc    GetSelection;
  119.   SetSelectionProc    SetSelection;
  120. } XmTextSourceRec;
  121.  
  122.  
  123. #ifdef __cplusplus
  124. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  125. #endif
  126.  
  127. #endif /*  _XmTextStrSoP_h */
  128. /* DON'T ADD ANYTHING AFTER THIS #endif */
  129.